package evolutionaryLoop.selectionProtocol;

import evolutionaryLoop.EvolutionaryParameters;
import evolutionaryLoop.Population;

public class OverProduction extends SelectionProtocol{
	
	public OverProduction(EvolutionaryParameters parameters){
		super(parameters); 
	}

	@Override
	public Population selection(Population children, Population parents) {
		if (children.size() < getPopulationSize()) {
			System.out.println("The children population size is to small, the children are returned. (MixingProtocol - OverProduction");
		}else {
			children.scaleToSize(getPopulationSize());
		}
		return children; 
	}
	
	public String toString(){
		return "Over production"; 
	}
	

}
